Optimal. Leaf size=205 \[ \frac{4 a^3 (A-i B) \tan ^{m+1}(c+d x) \text{Hypergeometric2F1}(1,m+1,m+2,i \tan (c+d x))}{d (m+1)}-\frac{a^3 \left (A \left (2 m^2+11 m+15\right )-i B \left (2 m^2+11 m+17\right )\right ) \tan ^{m+1}(c+d x)}{d (m+1) (m+2) (m+3)}-\frac{(A (m+3)-i B (m+5)) \left (a^3+i a^3 \tan (c+d x)\right ) \tan ^{m+1}(c+d x)}{d (m+2) (m+3)}+\frac{i a B (a+i a \tan (c+d x))^2 \tan ^{m+1}(c+d x)}{d (m+3)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.642078, antiderivative size = 205, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 34, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.147, Rules used = {3594, 3592, 3537, 12, 64} \[ \frac{4 a^3 (A-i B) \tan ^{m+1}(c+d x) \, _2F_1(1,m+1;m+2;i \tan (c+d x))}{d (m+1)}-\frac{a^3 \left (A \left (2 m^2+11 m+15\right )-i B \left (2 m^2+11 m+17\right )\right ) \tan ^{m+1}(c+d x)}{d (m+1) (m+2) (m+3)}-\frac{(A (m+3)-i B (m+5)) \left (a^3+i a^3 \tan (c+d x)\right ) \tan ^{m+1}(c+d x)}{d (m+2) (m+3)}+\frac{i a B (a+i a \tan (c+d x))^2 \tan ^{m+1}(c+d x)}{d (m+3)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3594
Rule 3592
Rule 3537
Rule 12
Rule 64
Rubi steps
\begin{align*} \int \tan ^m(c+d x) (a+i a \tan (c+d x))^3 (A+B \tan (c+d x)) \, dx &=\frac{i a B \tan ^{1+m}(c+d x) (a+i a \tan (c+d x))^2}{d (3+m)}+\frac{\int \tan ^m(c+d x) (a+i a \tan (c+d x))^2 (-a (i B (1+m)-A (3+m))+a (i A (3+m)+B (5+m)) \tan (c+d x)) \, dx}{3+m}\\ &=\frac{i a B \tan ^{1+m}(c+d x) (a+i a \tan (c+d x))^2}{d (3+m)}-\frac{(A (3+m)-i B (5+m)) \tan ^{1+m}(c+d x) \left (a^3+i a^3 \tan (c+d x)\right )}{d (2+m) (3+m)}+\frac{\int \tan ^m(c+d x) (a+i a \tan (c+d x)) \left (-a^2 \left (i B \left (7+9 m+2 m^2\right )-A \left (9+9 m+2 m^2\right )\right )+a^2 \left (i A \left (15+11 m+2 m^2\right )+B \left (17+11 m+2 m^2\right )\right ) \tan (c+d x)\right ) \, dx}{6+5 m+m^2}\\ &=-\frac{a^3 \left (A \left (15+11 m+2 m^2\right )-i B \left (17+11 m+2 m^2\right )\right ) \tan ^{1+m}(c+d x)}{d (1+m) \left (6+5 m+m^2\right )}+\frac{i a B \tan ^{1+m}(c+d x) (a+i a \tan (c+d x))^2}{d (3+m)}-\frac{(A (3+m)-i B (5+m)) \tan ^{1+m}(c+d x) \left (a^3+i a^3 \tan (c+d x)\right )}{d (2+m) (3+m)}+\frac{\int \tan ^m(c+d x) \left (4 a^3 (A-i B) (2+m) (3+m)+4 a^3 (i A+B) (2+m) (3+m) \tan (c+d x)\right ) \, dx}{6+5 m+m^2}\\ &=-\frac{a^3 \left (A \left (15+11 m+2 m^2\right )-i B \left (17+11 m+2 m^2\right )\right ) \tan ^{1+m}(c+d x)}{d (1+m) \left (6+5 m+m^2\right )}+\frac{i a B \tan ^{1+m}(c+d x) (a+i a \tan (c+d x))^2}{d (3+m)}-\frac{(A (3+m)-i B (5+m)) \tan ^{1+m}(c+d x) \left (a^3+i a^3 \tan (c+d x)\right )}{d (2+m) (3+m)}+\frac{\left (16 i a^6 (A-i B)^2 (2+m) (3+m)\right ) \operatorname{Subst}\left (\int \frac{4^{-m} \left (\frac{x}{a^3 (i A+B) (2+m) (3+m)}\right )^m}{16 a^6 (i A+B)^2 (2+m)^2 (3+m)^2+4 a^3 (A-i B) (2+m) (3+m) x} \, dx,x,4 a^3 (i A+B) (2+m) (3+m) \tan (c+d x)\right )}{d}\\ &=-\frac{a^3 \left (A \left (15+11 m+2 m^2\right )-i B \left (17+11 m+2 m^2\right )\right ) \tan ^{1+m}(c+d x)}{d (1+m) \left (6+5 m+m^2\right )}+\frac{i a B \tan ^{1+m}(c+d x) (a+i a \tan (c+d x))^2}{d (3+m)}-\frac{(A (3+m)-i B (5+m)) \tan ^{1+m}(c+d x) \left (a^3+i a^3 \tan (c+d x)\right )}{d (2+m) (3+m)}+\frac{\left (i 4^{2-m} a^6 (A-i B)^2 (2+m) (3+m)\right ) \operatorname{Subst}\left (\int \frac{\left (\frac{x}{a^3 (i A+B) (2+m) (3+m)}\right )^m}{16 a^6 (i A+B)^2 (2+m)^2 (3+m)^2+4 a^3 (A-i B) (2+m) (3+m) x} \, dx,x,4 a^3 (i A+B) (2+m) (3+m) \tan (c+d x)\right )}{d}\\ &=-\frac{a^3 \left (A \left (15+11 m+2 m^2\right )-i B \left (17+11 m+2 m^2\right )\right ) \tan ^{1+m}(c+d x)}{d (1+m) \left (6+5 m+m^2\right )}+\frac{4 a^3 (A-i B) \, _2F_1(1,1+m;2+m;i \tan (c+d x)) \tan ^{1+m}(c+d x)}{d (1+m)}+\frac{i a B \tan ^{1+m}(c+d x) (a+i a \tan (c+d x))^2}{d (3+m)}-\frac{(A (3+m)-i B (5+m)) \tan ^{1+m}(c+d x) \left (a^3+i a^3 \tan (c+d x)\right )}{d (2+m) (3+m)}\\ \end{align*}
Mathematica [A] time = 10.8678, size = 374, normalized size = 1.82 \[ -\frac{i e^{i c} \left (-\frac{i \left (-1+e^{2 i (c+d x)}\right )}{1+e^{2 i (c+d x)}}\right )^m \left (\frac{-1+e^{2 i (c+d x)}}{1+e^{2 i (c+d x)}}\right )^{-m} \cos ^4(c+d x) (a+i a \tan (c+d x))^3 (A+B \tan (c+d x)) \left (2 e^{-4 i c} (m+3) (A-i B) \left (-1+e^{2 i (c+d x)}\right )^{m+1} \left (2^{1-m} (m+2) \text{Hypergeometric2F1}\left (m+1,m+1,m+2,\frac{1}{2} \left (1-e^{2 i (c+d x)}\right )\right )+\left (-(4 m+7) e^{2 i (c+d x)}-2 m-5\right ) \left (1+e^{2 i (c+d x)}\right )^{-m-2}\right )+4 i B e^{-4 i c} \left (-1+e^{2 i (c+d x)}\right )^{m+1} \left (\left (2 m^2+8 m+7\right ) e^{4 i (c+d x)}+2 (m+2) e^{2 i (c+d x)}+1\right ) \left (1+e^{2 i (c+d x)}\right )^{-m-3}\right )}{2 d (m+1) (m+2) (m+3) (\cos (d x)+i \sin (d x))^3 (A \cos (c+d x)+B \sin (c+d x))} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 0.383, size = 0, normalized size = 0. \begin{align*} \int \left ( \tan \left ( dx+c \right ) \right ) ^{m} \left ( a+ia\tan \left ( dx+c \right ) \right ) ^{3} \left ( A+B\tan \left ( dx+c \right ) \right ) \, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (B \tan \left (d x + c\right ) + A\right )}{\left (i \, a \tan \left (d x + c\right ) + a\right )}^{3} \tan \left (d x + c\right )^{m}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{8 \,{\left ({\left (A - i \, B\right )} a^{3} e^{\left (8 i \, d x + 8 i \, c\right )} +{\left (A + i \, B\right )} a^{3} e^{\left (6 i \, d x + 6 i \, c\right )}\right )} \left (\frac{-i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}\right )^{m}}{e^{\left (8 i \, d x + 8 i \, c\right )} + 4 \, e^{\left (6 i \, d x + 6 i \, c\right )} + 6 \, e^{\left (4 i \, d x + 4 i \, c\right )} + 4 \, e^{\left (2 i \, d x + 2 i \, c\right )} + 1}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} a^{3} \left (\int A \tan ^{m}{\left (c + d x \right )}\, dx + \int - 3 A \tan ^{2}{\left (c + d x \right )} \tan ^{m}{\left (c + d x \right )}\, dx + \int B \tan{\left (c + d x \right )} \tan ^{m}{\left (c + d x \right )}\, dx + \int - 3 B \tan ^{3}{\left (c + d x \right )} \tan ^{m}{\left (c + d x \right )}\, dx + \int 3 i A \tan{\left (c + d x \right )} \tan ^{m}{\left (c + d x \right )}\, dx + \int - i A \tan ^{3}{\left (c + d x \right )} \tan ^{m}{\left (c + d x \right )}\, dx + \int 3 i B \tan ^{2}{\left (c + d x \right )} \tan ^{m}{\left (c + d x \right )}\, dx + \int - i B \tan ^{4}{\left (c + d x \right )} \tan ^{m}{\left (c + d x \right )}\, dx\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (B \tan \left (d x + c\right ) + A\right )}{\left (i \, a \tan \left (d x + c\right ) + a\right )}^{3} \tan \left (d x + c\right )^{m}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]